/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

import BLL.BCategory2;
import java.util.ArrayList;

/**
 *
 * @author Vien-IT
 */
public class Category1 {
    private int category1Id;
    private String name;
    private ArrayList<Category2> categories2;

    /**
     * @return the category1Id
     */
    public int getCategory1Id() {
        return category1Id;
    }

    /**
     * @param category1Id the category1Id to set
     */
    public void setCategory1Id(int category1Id) {
        this.category1Id = category1Id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the categories2
     */
    public ArrayList<Category2> getCategories2() {
        if(categories2 == null)
        {
            categories2 = new BCategory2().getByCategory1Id(category1Id);
        }
        return categories2;
    }

   
    
    
}
